<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(Program).Assembly">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData">
                <Authorizing>
                    <LayoutView Layout="@typeof(HeaderLayout)">
                        <div class="loader"></div>
                    </LayoutView>
                </Authorizing>
                <NotAuthorized>
                    @if (!context.User.Identity.IsAuthenticated)
                    {
                        <NotLoggedIn />
                    }
                    else
                    {
                        <LayoutView Layout="@typeof(HeaderLayout)">
                            <p>You are not authorized to access this resource.</p>
                        </LayoutView>
                    }
                    </NotAuthorized>
            </AuthorizeRouteView>
        </Found>
        <NotFound>
            <LayoutView Layout="@typeof(HeaderLayout)">
                <p>Sorry, there's nothing at this address.</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>
